# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=udisks2
pkgver=2.9.4
pkgrel=1
pkgdesc="Disk Management Service, version 2"
arch=('x86_64')
url="https://www.freedesktop.org/wiki/Software/udisks"
license=('GPL2')
depends=('polkit' 'libatasmart' 'libgudev' 'libblockdev')
makedepends=('docbook-xsl' 'gobject-introspection' 'parted' 'gtk-doc')
optdepends=('gptfdisk: GUID partition table support'
            'ntfs-3g: NTFS filesystem management support'
            'dosfstools: VFAT filesystem management support')
backup=('etc/udisks2/udisks2.conf')
source=("https://github.com/storaged-project/udisks/archive/udisks-$pkgver.tar.gz")
sha512sums=('5b266cbc29f55d4c4a5100147793becf32a95f94bc7e184796bd2505a4e958a6bce9e5ffa584e4a89c7b874ed14ba6d9d096659565d0f51d860ef216d0cbd435')

prepare() {
  cd udisks-udisks-$pkgver
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd udisks-udisks-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc \
      --sbindir=/usr/bin --libexecdir=/usr/lib \
      --with-systemdsystemunitdir=/usr/lib/systemd/system \
      --localstatedir=/var --disable-static \
      --enable-gtk-doc enable_available_modules=yes
  make
}

check() {
  cd udisks-udisks-$pkgver
  make check
}

package() {
  cd udisks-udisks-$pkgver
  make DESTDIR="$pkgdir" install
}
